package com.lifeng.listener;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.apache.rocketmq.spring.core.RocketMQReplyListener;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @description:收到消息并同步返回
 * @author: lifeng
 * @create: 2020/9/18 16:08
 * RocketMQReplyListener 第一个参数为接受类型 第二个参数返回类型
 */
@Component
@RocketMQMessageListener(topic = "lifeng-topic-3", consumerGroup = "lifeng-topic-consumer-group-3")
public class ListenerService3 implements RocketMQReplyListener<Map,Map> {
    @Override
    public Map onMessage(Map s) {
        System.out.println("收到消息:"+s);
        s.put("ret","1");
        return s;
    }
}
